from greenlet import greenlet

def produce():
    for i in range(3):
        print('produce ', i)
        yield i

def consume():
    coverter = covert()
    for i in range(3):
        item = next(coverter)
        print('        consume ', item)

def covert():
    producer = produce()
    for i in range(3):
        item = next(producer)
        if item != 0:
            temp = str(item) + '0'
        else:
            temp = str(item)
        print('  covert ', item, ' -> ', temp)
        yield temp
        

consume()
